import request from "/@/utils/request"

export function fetchList(query?: Object) {
  return request({
    url: '/ai/dataset/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj?: Object) {
  return request({
    url: '/ai/dataset/insertCreate',
    method: 'put',
    data: obj
  })
}

export function getObj(id?: string) {
  return request({
    url: '/ai/dataset/viewdetail/' + id,
    method: 'get'
  })
}

export function delObjs(id?: String) {
  return request({
    url: '/ai/dataset/delete/' + id,
    method: 'get'
  })
}


export function pageList(query?: Object) {
  return request({
    url: '/ai/dataset/dataSetList',
    method: 'get',
    params: query
  })
}


export function addSdObj(obj?: Object) {
  return request({
    url: '/ai/dataset/collectionCreate',
    method: 'put',
    data: obj
  })
}

export function addbgObj(formData?: Object) {
  return request({
    url: '/ai/dataset/localFile',
    method: 'post',
    data: formData
  })
}

export function addtextObj(formData?: Object) {
  return request({
    url: '/ai/dataset/localTextFile',
    method: 'post',
    data: formData
  })
}


export function datasetList(query?: Object) {
  return request({
    url: '/ai/dataset/datasetcoreList',
    method: 'get',
    params: query
  })
}